package com.google.denta.dao;

import java.util.List;

import com.google.denta.entity.Group;


/**
 * @author Ihar_Padaliakin
 */
public interface GroupDao extends Dao<Group, Long> {

    /**
     * @return list of all groups.
     */
    List<Group> findAll();

    /**
     * @param name
     *            - name of group
     * @return list of all groups.
     */
    Group findByName(String name);

    /**
     * Create group role.
     * @param gid
     *            - group id
     * @param rid
     *            - role id
     */
    void createGroupRole(Long gid, Long rid);

    /**
     * Delete group roles.
     * @param id
     *            - group id
     */
    void deleteGroupRoles(Long id);

    /**
     * Delete all users from group.
     * @param gid
     *            - group id
     */
    void deleteGroupUsers(Long gid);

    /**
     * Delete group users by their ids.
     * @param gid
     *            - group id
     * @param uid
     *            - user id
     */
    void deleteGroupUser(Long gid, Long uid);

    /**
     * Add group user by its id.
     * @param gid
     *            - group id
     * @param uid
     *            - user id
     */
    void addGroupUser(Long gid, Long uid);
}
